<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <style>
.homeBox{
        display:flex;
        justify-content: space-around;
    }
    </style>
    
  </head>
  <body>
    <div id="app">
      <h1>{{msg}}</h1>
      
      <home>
        <span slot="left">左边返回箭头</span>
        <h2>中间是title</h2>
        <span slot="right">右边小图标</span>
      </home>

      <hr>

      <home>
        <span slot="left">左边返回箭头</span>
        <h2>中间是title</h2>
      </home>
    </div>

    <template id="home">
      <div class="homeBox">
         <!-- 具名插槽 -->
         <slot name='left'></slot>
         <slot></slot>
         <slot name='right'></slot>
      </div>
    </template>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>

      Vue.component('home',{
        template:'#home'
      })

      var vm = new Vue({
        el: "#app",
        data: {
          msg: "vue",
        },
        methods: {},
      });
    </script>
  </body>
</html>
